const { defineConfig } = require("@vue/cli-service");
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");

const path = require("path");

module.exports = defineConfig({
  publicPath: "/manager",
  transpileDependencies: true,
  devServer: {
    allowedHosts: "all", // 允许所有主机名
    port: 9528, // 你的端口号，如果不指定，默认是8080
    proxy: {
      "/api": {
        target: "http://localhost:7001/api",
        changeOrigin: true,
        pathRewrite: {
          "^/api": "",
        },
      },
    },
  },
  chainWebpack: (config) => {
    config.plugin("polyfills").use(NodePolyfillPlugin);
  },
  configureWebpack: {
    resolve: {
      alias: {
        "@": path.resolve(__dirname, "src"),
      },
    },
  },
});
